<template>
    <div class="model" v-show="sync">
        <span @click="close">x</span>
        {{ title }}
        <slot></slot>
        <button v-for="(item,index) in btnList" :key="index" @click="item.click">{{ item.name }}</button>
    </div>
</template>

<script>
export default {
    props: ['sync', 'title', 'btnList'],
    methods: {
        close() {
            // 通知父级
            this.$emit('closeFun')
        }
    }
}
</script>

<style>
</style>
